package com.example.streamdemo.controller;

import com.example.streamdemo.bean.Person;
import com.example.streamdemo.producer.MyMessageProducer2;
import com.example.streamdemo.producer.MyMessageProducer3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Package: com.example.streamdemo.controller
 * @ClassName: ProducerController
 * @Author: Think
 * @CreateTime: 2021/7/15 16:40
 * @Description:
 */
@RestController
public class ProducerController3 {

    @Autowired
    private MyMessageProducer3 producer;

    @GetMapping("/sendMessage3")
    public String sendMessage(){
        Person tom = new Person("tom", 21);
        producer.send(tom);
        return "OK";
    }

}
